﻿#ifndef MYGVIEW_H
#define MYGVIEW_H

#include <QGraphicsView>
#include <QDebug>
#include <QPoint>
#include <QResizeEvent>
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QTextStream>
#include <QScrollBar>
#include <QMouseEvent>
#include <QWheelEvent>
#include "mymap.h"

class MyGView : public QGraphicsView
{
    Q_OBJECT;
public:
    MyGView(QWidget *parent = 0);


protected:
    virtual void resizeEvent ( QResizeEvent * event );
    virtual void mousePressEvent(QMouseEvent *event);
    virtual void mouseReleaseEvent(QMouseEvent *event);
    virtual void mouseMoveEvent(QMouseEvent* event);
    virtual void wheelEvent(QWheelEvent* event);
    virtual void keyPressEvent(QKeyEvent * keyEvent);
    virtual void mouseDoubleClickEvent(QMouseEvent *event);
    virtual void dropEvent(QDropEvent *event);

    //Holds the current centerpoint for the view, used for panning and zooming
    QPointF CurrentCenterPoint;

    //From panning the view
    QPoint LastPanPoint;
    bool beginLine;
    bool isScale;


    //Set the current centerpoint in the
    void SetCenter(const QPointF& centerPoint);
    QPointF GetCenter() { return CurrentCenterPoint; }

public slots:

signals:

    void gvPress(QPoint *);
    void dblClick(QPoint *);
    void rbClick(QPoint *);



};

#endif // MYGVIEW_H
